package 结构型模式.适配器模式.对象适配器;

import 结构型模式.适配器模式.类适配器.TFCard;

public class SDAdaptTF implements SDCard {
    //声明适配者（源）类
    //解除extends，换为私有对象声明是为了用耦合
    private TFCard tfCard;

    public SDAdaptTF(TFCard tfCard) {
        this.tfCard = tfCard;
    }

    @Override
    public String readSD() {
        System.out.println("adapter read tf card");
        return tfCard.readTF();
    }

    @Override
    public void writeSD(String msg) {
        System.out.println("adapter write tf card");
        tfCard.writeTF(msg);
    }
}
